package happy.diandiankong.api.db;

import happy.diandiankong.api.model.Users;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Title.
 * <p>
 * Description.
 *
 * @author Bill Lv {@literal <billcc.lv@hotmail.com>}
 * @version 1.0
 * @since 2016-10-30
 */
public class UserMapper implements ResultSetMapper<Users> {

    @Override
    public Users map(int index, ResultSet r, StatementContext ctx) throws SQLException {
        return new Users(r.getLong("ID"), r.getString("NAME"), r.getLong("GROUP_ID"));
    }

}
